namespace TXLooker.WorkItemExtention.WIQL
{
    using System;
    using System.Runtime.Serialization;

    [Serializable]
    public class SyntaxException : ApplicationException
    {
        private SyntaxError m_code;
        private Node m_node;

        public SyntaxException()
        {
        }

        public SyntaxException(Node node, SyntaxError err) : base(ResourceStrings.Get(err.ToString()))
        {
            this.m_node = node;
            this.m_code = err;
        }

        protected SyntaxException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }

        public string Details
        {
            get
            {
                if (this.m_node != null)
                {
                    return ResourceStrings.Format("DetailedMessage", new object[] { this.Message, this.m_node.ToString() });
                }
                return this.Message;
            }
        }

        public Node Node
        {
            get
            {
                return this.m_node;
            }
        }

        public SyntaxError SyntaxError
        {
            get
            {
                return this.m_code;
            }
        }
    }
}

